<?php
/**
 * Created by PhpStorm.
 * User: 曾剑杰
 * Email: kevin0217@126.com
 * @ Date: 2024-09-10
 * Time: 15:12
 */

namespace app\common\model;

use think\Model;

class Packaged extends Model
{
    protected $name = 'packaged';
    const STATUS_OFF = 0;
    const STATUS_ON = 1;

    public function dressup()
    {
        return $this->belongsToMany(Dressup::class, Dressuppackaged::class, 'dressup_id', 'packaged_id')->where('status', Dressup::STATUS_ON);
    }

    public function userDressupPackage()
    {
        return $this->belongsTo(UserDressupPackaged::class,'id','packaged_id');
    }

//    public function itemdata()
//    {
//        return $this->morphOne(OrderItem::class, ['data_type','data_id'],'itemdata');
//    }

}